home *** CD-ROM | disk | FTP | other *** search
/ Games Gallery 98 / Games Gallery 98 - Disc 1.iso / Content / HENGE / Henge.exe / Henge.dxr / Internal (code)_32_Internal Stub Code.ls < prev    next >
Encoding:
Text File  |  1998-02-15  |  14.3 KB  |  498 lines

  1. on playPath path, channelrange, cycletime, cycles, rateflag, relativeflag, polyflag, reverseflag
  2.   global userobject
  3.   set path to callAncestor(#preparePath, userobject, path)
  4.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  5.   set cycletime to callAncestor(#prepareCycletime, userobject, cycletime)
  6.   set cycles to callAncestor(#prepareCycles, userobject, cycles)
  7.   case 1 of
  8.     (path < 0):
  9.       return path
  10.     (channelrange < 0):
  11.       return channelrange
  12.     (cycletime < 0):
  13.       return cycletime
  14.     (cycles < 0):
  15.       return cycles
  16.   end case
  17.   set instance to new(script "Path Object", channelrange)
  18.   call(#setUp, instance, path, cycletime, cycles, rateflag, relativeflag, polyflag, reverseflag, the timer)
  19.   return instance
  20. end
  21.  
  22. on playCels framerange, channelrange, cycletime, cycles, rateflag, relativeflag, smoothflag, reverseflag
  23.   global userobject
  24.   set framerange to callAncestor(#prepareFrameRange, userobject, framerange)
  25.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  26.   set cycletime to callAncestor(#prepareCycletime, userobject, cycletime)
  27.   set cycles to callAncestor(#prepareCycles, userobject, cycles)
  28.   case 1 of
  29.     (framerange < 0):
  30.       return framerange
  31.     (channelrange < 0):
  32.       return channelrange
  33.     (cycletime < 0):
  34.       return cycletime
  35.     (cycles < 0):
  36.       return cycles
  37.   end case
  38.   set instance to new(script "Cels Object", channelrange)
  39.   call(#setUp, instance, framerange, cycletime, cycles, rateflag, relativeflag, smoothflag, reverseflag, the timer)
  40.   return instance
  41. end
  42.  
  43. on playSequence sequence, channelrange, cycletime, cycles, rateflag, reverseflag
  44.   global userobject
  45.   set sequence to callAncestor(#prepareSequence, userobject, sequence)
  46.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  47.   set cycletime to callAncestor(#prepareCycletime, userobject, cycletime)
  48.   set cycles to callAncestor(#prepareCycles, userobject, cycles)
  49.   case 1 of
  50.     (sequence < 0):
  51.       return sequence
  52.     (channelrange < 0):
  53.       return channelrange
  54.     (cycletime < 0):
  55.       return cycletime
  56.     (cycles < 0):
  57.       return cycles
  58.   end case
  59.   set instance to new(script "Sequence Object", channelrange)
  60.   call(#setUp, instance, sequence, cycletime, cycles, rateflag, reverseflag, the timer)
  61.   return instance
  62. end
  63.  
  64. on setStage framenumber, channelrange
  65.   global userobject
  66.   if voidp(channelrange) then
  67.     set channelrange to [1, the maxchannel of userobject]
  68.   end if
  69.   set framenumber to callAncestor(#prepareFrameRange, userobject, framenumber)
  70.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  71.   case 1 of
  72.     (framenumber < 0):
  73.       return framenumber
  74.     (channelrange < 0):
  75.       return channelrange
  76.   end case
  77.   return setStage(userobject, getAt(framenumber, 1), channelrange)
  78. end
  79.  
  80. on pauseAnimation instance, notflag
  81.   global userobject
  82.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  83.   if instance < 0 then
  84.     return instance
  85.   end if
  86.   callAncestor(#pause, instance)
  87.   return 1
  88. end
  89.  
  90. on resumeAnimation instance, notflag
  91.   global userobject
  92.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  93.   if instance < 0 then
  94.     return instance
  95.   end if
  96.   callAncestor(#resume, instance)
  97. end
  98.  
  99. on reverseAnimation instance, notflag
  100.   global userobject
  101.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  102.   if instance < 0 then
  103.     return instance
  104.   end if
  105.   call(#reverse, instance)
  106.   return 1
  107. end
  108.  
  109. on stopAnimation instance, notflag
  110.   global userobject
  111.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  112.   if instance < 0 then
  113.     return instance
  114.   end if
  115.   callAncestor(#stop, instance)
  116.   return 1
  117. end
  118.  
  119. on finishAnimation instance, interuptflag, notflag
  120.   global userobject
  121.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  122.   if instance < 0 then
  123.     return instance
  124.   end if
  125.   return call(#finish, userobject, instance, interuptflag)
  126. end
  127.  
  128. on delayAnimation delay, instance, notflag
  129.   global userobject
  130.   set delay to callAncestor(#prepareDelay, userobject, delay)
  131.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  132.   case 1 of
  133.     (delay < 0):
  134.       return delay
  135.     (instance < 0):
  136.       return instance
  137.   end case
  138.   callAncestor(#delay, instance, delay)
  139.   return 1
  140. end
  141.  
  142. on paceAnimation playrate, instance, notflag
  143.   global userobject
  144.   set playrate to callAncestor(#preparePercent, userobject, playrate)
  145.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  146.   case 1 of
  147.     (playrate < 0):
  148.       return playrate
  149.     (instance < 0):
  150.       return instance
  151.   end case
  152.   callAncestor(#pace, instance, playrate)
  153. end
  154.  
  155. on offsetAnimation horzoffset, vertoffset, instance, notflag
  156.   global userobject
  157.   set horzoffset to callAncestor(#prepareLocValue, userobject, horzoffset)
  158.   set vertoffset to callAncestor(#prepareLocValue, userobject, vertoffset)
  159.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  160.   case 1 of
  161.     stringp(horzoffset):
  162.       return value(horzoffset)
  163.     stringp(vertoffset):
  164.       return value(vertoffset)
  165.     (instance < 0):
  166.       return instance
  167.   end case
  168.   call(#offset, instance, horzoffset, vertoffset)
  169. end
  170.  
  171. on scaleAnimation horzpercent, vertpercent, instance, relativeflag, notflag
  172.   global userobject
  173.   set horzpercent to callAncestor(#preparePercent, userobject, horzpercent)
  174.   set vertpercent to callAncestor(#preparePercent, userobject, vertpercent)
  175.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  176.   case 1 of
  177.     (horzpercent < 0):
  178.       returnhorzpercent()
  179.     (vertpercent < 0):
  180.       return vertpercent
  181.     (instance < 0):
  182.       return instance
  183.   end case
  184.   call(#scale, instance, horzpercent, vertpercent, relativeflag)
  185. end
  186.  
  187. on rotateAnimation rotation, instance, relativeflag, notflag
  188.   global userobject
  189.   set rotation to callAncestor(#prepareRotation, userobject, rotation)
  190.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  191.   case 1 of
  192.     (rotation < 0):
  193.       return rotation
  194.     (instance < 0):
  195.       return instance
  196.   end case
  197.   call(#rotate, instance, rotation, relativeflag)
  198. end
  199.  
  200. on retargetAnimation horz, vert, instance, relativeflag, notflag
  201.   global userobject
  202.   set horz to callAncestor(#prepareLocValue, userobject, horz)
  203.   set vert to callAncestor(#prepareLocValue, userobject, vert)
  204.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  205.   case 1 of
  206.     stringp(horz):
  207.       return value(horz)
  208.     stringp(vert):
  209.       return value(vert)
  210.     (instance < 0):
  211.       return instance
  212.   end case
  213.   call(#retarget, instance, horz, vert, relativeflag)
  214. end
  215.  
  216. on snapAnimation snaphorz, snapvert, instance, notflag
  217.   global userobject
  218.   set snaphorz to callAncestor(#prepareSnap, userobject, snaphorz)
  219.   set snapvert to callAncestor(#prepareSnap, userobject, snapvert)
  220.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  221.   case 1 of
  222.     (snaphorz < 0):
  223.       return snaphorz
  224.     (snapvert < 0):
  225.       return snapvert
  226.     (instance < 0):
  227.       return instance
  228.   end case
  229.   call(#snap, instance, snaphorz, snapvert)
  230. end
  231.  
  232. on setCycle cycles, instance, notflag
  233.   global userobject
  234.   set cycles to callAncestor(#prepareCycles, userobject, cycles)
  235.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  236.   case 1 of
  237.     (cycles < 0):
  238.       return cycles
  239.     (instance < 0):
  240.       return instance
  241.   end case
  242.   callAncestor(#setCycle, instance, cycles)
  243. end
  244.  
  245. on setCycletime newcycletime, instance, notflag
  246.   global userobject
  247.   set newcycletime to callAncestor(#prepareCycletime, userobject, newcycletime)
  248.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  249.   case 1 of
  250.     (newcycletime < 0):
  251.       return newcycletime
  252.     (instance < 0):
  253.       return instance
  254.   end case
  255.   callAncestor(#setCycletime, instance, newcycletime)
  256. end
  257.  
  258. on setCyclePercent newcyclepercent, instance, notflag
  259.   global userobject
  260.   set newcyclepercent to callAncestor(#preparePercent, userobject, newcyclepercent)
  261.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  262.   case 1 of
  263.     (newcyclepercent < 0):
  264.       return newcyclepercent
  265.     (instance < 0):
  266.       return instance
  267.   end case
  268.   callAncestor(#setCyclePercent, instance, newcyclepercent)
  269. end
  270.  
  271. on setPath newpath, instance, notflag
  272.   global userobject
  273.   set newpath to callAncestor(#preparePath, userobject, newpath)
  274.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  275.   case 1 of
  276.     (newpath < 0):
  277.       return newpath
  278.     (instance < 0):
  279.       return instance
  280.   end case
  281.   call(#setPath, instance, newpath)
  282. end
  283.  
  284. on getMouseDirection
  285.   global trackobject
  286.   return call(#getMouseDirection, trackobject)
  287. end
  288.  
  289. on getMouseSpeed
  290.   global trackobject
  291.   return call(#getMouseSpeed, trackobject)
  292. end
  293.  
  294. on getMouseVector channel
  295.   global userobject, trackobject
  296.   set channel to callAncestor(#prepareChannelrange, userobject, channel)
  297.   if channel < 0 then
  298.     set channel to 0
  299.   else
  300.     set channel to getAt(channel, 1)
  301.   end if
  302.   return call(#getMouseVector, trackobject, channel)
  303. end
  304.  
  305. on getSpriteDirection channelrange
  306.   global userobject, trackobject
  307.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  308.   if channelrange < 0 then
  309.     return channelrange
  310.   end if
  311.   return call(#getSpriteDirection, trackobject, channelrange)
  312. end
  313.  
  314. on getSpriteSpeed channelrange
  315.   global userobject, trackobject
  316.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  317.   if channelrange < 0 then
  318.     return channelrange
  319.   end if
  320.   return call(#getSpriteSpeed, trackobject, channelrange)
  321. end
  322.  
  323. on getSpriteVector channelrange
  324.   global userobject, trackobject
  325.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  326.   if channelrange < 0 then
  327.     return channelrange
  328.   end if
  329.   return call(#getSpriteVector, trackobject, channelrange)
  330. end
  331.  
  332. on getCycleTime instance, notflag
  333.   global userobject
  334.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  335.   if instance < 0 then
  336.     return instance
  337.   end if
  338.   set returnlist to [:]
  339.   repeat with n = 1 to count(instance)
  340.     set me to getAt(instance, n)
  341.     addProp(returnlist, me, the cycletime of me)
  342.   end repeat
  343.   if count(returnlist) = 1 then
  344.     return getAt(returnlist, 1)
  345.   else
  346.     return returnlist
  347.   end if
  348. end
  349.  
  350. on getCycle instance, notflag
  351.   global userobject
  352.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  353.   if instance < 0 then
  354.     return instance
  355.   end if
  356.   set returnlist to [:]
  357.   repeat with n = 1 to count(instance)
  358.     set me to getAt(instance, n)
  359.     addProp(returnlist, me, the currentcycle of me)
  360.   end repeat
  361.   if count(returnlist) = 1 then
  362.     return getAt(returnlist, 1)
  363.   else
  364.     return returnlist
  365.   end if
  366. end
  367.  
  368. on getCyclePercent instance, notflag
  369.   global userobject
  370.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  371.   if instance < 0 then
  372.     return instance
  373.   end if
  374.   set returnlist to [:]
  375.   repeat with n = 1 to count(instance)
  376.     set me to getAt(instance, n)
  377.     addProp(returnlist, me, callAncestor(#getCyclePercent, me))
  378.   end repeat
  379.   if count(returnlist) = 1 then
  380.     return getAt(returnlist, 1)
  381.   else
  382.     return returnlist
  383.   end if
  384. end
  385.  
  386. on getFinishedPercent instance, notflag
  387.   global userobject
  388.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  389.   if instance < 0 then
  390.     return instance
  391.   end if
  392.   set returnlist to [:]
  393.   repeat with n = 1 to count(instance)
  394.     set me to getAt(instance, n)
  395.     addProp(returnlist, me, callAncestor(#getFinishedPercent, me))
  396.   end repeat
  397.   if count(returnlist) = 1 then
  398.     return getAt(returnlist, 1)
  399.   else
  400.     return returnlist
  401.   end if
  402. end
  403.  
  404. on getChannelList instance, notflag
  405.   global userobject
  406.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  407.   if instance < 0 then
  408.     return instance
  409.   end if
  410.   set returnlist to [:]
  411.   repeat with n = 1 to count(instance)
  412.     set me to getAt(instance, n)
  413.     addProp(returnlist, me, the channel of me)
  414.   end repeat
  415.   if count(returnlist) = 1 then
  416.     return getAt(returnlist, 1)
  417.   else
  418.     return returnlist
  419.   end if
  420. end
  421.  
  422. on animationP instance
  423.   global userobject, childlist
  424.   if not objectp(instance) and not listp(instance) then
  425.     return 0
  426.   end if
  427.   set instance to callAncestor(#prepareInstance, userobject, instance, 0)
  428.   if instance < 0 then
  429.     return 0
  430.   end if
  431.   repeat with n = 1 to count(instance)
  432.     if getOne(childlist, getAt(instance, n)) > 0 then
  433.       return 1
  434.     end if
  435.   end repeat
  436.   return 0
  437. end
  438.  
  439. on getAnimationError error
  440.   global userobject
  441.   return call(#getAnimationError, userobject, error)
  442. end
  443.  
  444. on getPath instance, notflag
  445.   global userobject
  446.   set instance to callAncestor(#prepareInstance, userobject, instance, notflag)
  447.   if instance < 0 then
  448.     return instance
  449.   end if
  450.   set returnlist to [:]
  451.   repeat with n = 1 to count(instance)
  452.     set me to getAt(instance, n)
  453.     addProp(returnlist, me, call(#getPath, me))
  454.   end repeat
  455.   if count(returnlist) = 1 then
  456.     return getAt(returnlist, 1)
  457.   else
  458.     return returnlist
  459.   end if
  460. end
  461.  
  462. on importPath filepathname
  463.   global userobject
  464.   return call(#import, userobject, filepathname)
  465. end
  466.  
  467. on pathToScore path, framerange, channelrange, polyflag, overwriteflag, reverseflag
  468.   global userobject
  469.   set path to callAncestor(#preparePath, userobject, path)
  470.   set framerange to callAncestor(#prepareFrameRange, userobject, framerange)
  471.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  472.   case 1 of
  473.     (path < 0):
  474.       return path
  475.     (framerange < 0):
  476.       return framerange
  477.     (channelrange < 0):
  478.       return channelrange
  479.   end case
  480.   call(#pathToScore, userobject, path, framerange, channelrange, polyflag, overwriteflag, reverseflag)
  481. end
  482.  
  483. on sequenceToScore sequence, framerange, channelrange, overwriteflag, reverseflag
  484.   global userobject
  485.   set sequence to callAncestor(#prepareSequence, userobject, sequence)
  486.   set framerange to callAncestor(#prepareFrameRange, userobject, framerange)
  487.   set channelrange to callAncestor(#prepareChannelrange, userobject, channelrange)
  488.   case 1 of
  489.     (sequence < 0):
  490.       return sequence
  491.     (framerange < 0):
  492.       return framerange
  493.     (channelrange < 0):
  494.       return channelrange
  495.   end case
  496.   call(#sequenceToScore, userobject, sequence, framerange, channelrange, overwriteflag, reverseflag)
  497. end
  498.